<template>
	<view>
		<view class="rule-box">
				
			<image class="rule-img" mode="widthFix" @click="showAgreement(5)" src="https://web.78keji.cn/images/nangua/guize.png">
			</image>
			<image class="rule-img" mode="widthFix" @click="telMobile" src="https://web.78keji.cn/images/nangua/kefu.png"></image>
			<image class="rule-img" mode="widthFix"  src="https://web.78keji.cn/images/nangua/lq.png" @click="gotoQuanyi"></image>
		
		</view>
		<view v-if="isShowRule" class="rule-content-box">
			<image @click="isShowRule = false" class="rule-img" mode="widthFix" :src="baseImagePath + 'rule.png'">
			</image>
		</view>
	</view>
</template>

<script>
	import zfbUrlUtil from "../../utils/zfbUrlUtil";
	export default {
		data() {
			return {
				isShowRule: false,
			};
		},
		props: ['baseImagePath'],
		methods: {
			telMobile() {
				uni.makePhoneCall({
					phoneNumber: '4008825010'
				})
			},
			gotoQuanyi() {
			if(uni.getStorageSync('mobile')){
					let url = zfbUrlUtil.wrapUrl('https://web.78keji.cn/newlq/#/?mobile='+uni.getStorageSync('mobile'))								my.ap.openURL({						url: url,						success: (res) => {							console.log('openURL success', res)						},						fail: (err) => {							console.log('openURL success', err)						}					});
			}else{
			
					uni.showToast({
						title: '请先办理权益',
						icon: 'none', //将值设置为 success 或者 ''
						duration: 2000 //持续时间为 2秒
					})
			}
			
			
			},
			showAgreement(value) {
				this.$emit('showAgreement', value)
			}
		}
	}
</script>

<style lang="scss">
	.rule-box {
		position: fixed;
		top: 310rpx;
		right: 15rpx;

		.rule-img {
			width: 60rpx;
			height: auto;
			margin-bottom: 20rpx;
			display: block;
		}
	}


	.rule-content-box {
		position: fixed;
		width: 100%;
		height: 100vh;
		left: 0;
		top: 0;
		overflow: auto;
		z-index: 9;

		.rule-img {
			width: 100%;
			height: auto;
		}
		
	}
	.rule-imgs{
		width: 110rpx;
		position: fixed;right: 0;
		top: 420rpx;
	}
</style>